Skip to content

Claude/fix https san extension h py pq#23

Closed
NerdsCorp wants to merge 5 commits into
mainfrom
claude/fix-https-san-extension-hPyPq
Closed

Claude/fix https san extension h py pq#23
NerdsCorp wants to merge 5 commits into
mainfrom
claude/fix-https-san-extension-hPyPq

Conversation

@NerdsCorp

Copy link
Copy Markdown
Owner

No description provided.

Adds SAN extension with localhost DNS name and IPv4/IPv6 loopback addresses
to self-signed certificates generated by the server. This resolves the
browser warning about missing subjectAlternativeName extension.
Resolves the 400 Bad Request error when uploading large files (>30MB) to the
editor updates endpoint. The issue was caused by ASP.NET Core's default 30MB
request body size limit.

Changes:
- Added [RequestSizeLimit(524_288_000)] attribute to upload endpoints
- Added [RequestFormLimits(MultipartBodyLengthLimit = 524_288_000)] attribute
- Configured global FormOptions with increased limits for multipart uploads
- Set MultipartBodyLengthLimit to 500MB to accommodate large game asset uploads

This allows the editor to successfully upload client update packages without
hitting request size validation errors.
This is the critical missing piece - Kestrel itself has a 30MB default
MaxRequestBodySize limit that was blocking the 47MB uploads even though
we configured ASP.NET Core's FormOptions.

Added MaxRequestBodySize: 524288000 (500MB) to:
- appsettings.json (base configuration)
- appsettings.Production.json (production environment - currently active)
- appsettings.Development.json (development environment)

This completes the three-layer fix for large file uploads:
1. Kestrel MaxRequestBodySize (was 30MB, now 500MB)
2. ASP.NET FormOptions limits (configured in ApiService.cs)
3. Controller-level attributes (configured in EditorUpdatesController.cs)
Added Kestrel timeout configurations to prevent connection drops during
large file uploads:

- KeepAliveTimeout: 10 minutes (default: 2 minutes)
- RequestHeadersTimeout: 10 minutes (default: 30 seconds)
- MinRequestBodyDataRate: 100 bytes/second with 10 minute grace period
  (default: 240 bytes/second with 5 second grace period)

The "error while copying content to stream" error indicates the connection
was being closed mid-upload, likely due to Kestrel's strict data rate
enforcement. A 47MB upload on a slower connection could take several minutes
and trigger the default timeout.

These relaxed limits allow for:
- Slow network connections
- Large file uploads (up to 500MB)
- Sufficient time to complete multi-file uploads
Adds a robust chunked upload system to handle multi-GB game files with
resume capability. Files larger than 10MB are automatically uploaded in
10MB chunks to avoid HTTP request size limitations and timeout issues.

Server Changes (ChunkedUploadController):
- POST /api/v1/editor/chunked-upload/init - Initialize upload session
- POST /api/v1/editor/chunked-upload/chunk - Upload individual chunks
- GET /api/v1/editor/chunked-upload/status/{sessionId} - Check upload status
- POST /api/v1/editor/chunked-upload/finalize - Assemble chunks into final file
- DELETE /api/v1/editor/chunked-upload/{sessionId} - Cancel upload session

Features:
- Unlimited file size support (multi-GB files)
- Automatic retry with exponential backoff per chunk
- Resume capability by tracking uploaded chunks
- Progress tracking per chunk
- Temporary storage with automatic cleanup
- Security: path validation to prevent directory traversal
- Integrated with existing Developer policy authorization

Client Changes (FrmUploadToServer):
- Automatic detection: files >10MB use chunked upload, smaller files use simple upload
- 10MB chunk size for optimal balance of speed and reliability
- Detailed progress feedback during chunk uploads
- Per-chunk retry logic with exponential backoff
- Graceful fallback to simple upload for small files

Benefits:
- No more 500MB request size limit
- No more timeout issues on slow connections
- Reliable uploads with automatic retry
- Better progress feedback for users
- Resume capability if connection drops
@NerdsCorp NerdsCorp closed this Dec 28, 2025
@NerdsCorp NerdsCorp deleted the claude/fix-https-san-extension-hPyPq branch December 28, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants